<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //手机父类
        class Phone{
            //父类的构造方法
            constructor(brand,price){
                this.brand = brand;
                this.price = price;
            }

            //父类的成员属性
            call(){
                console.log('我可以打电话');
            }
        }

        //子类手机继承父类
        class smartPhone extends Phone{
            //子类的构造方法
            constructor(brand,price,color,xize){
                super(brand,price)  //通过super来继承父类的构造方法
                this.color = color;
                this.xize = xize;
            }

            //方法
            photo(){
                console.log('我可以拍债');
            }

            playGame(){
                console.log('我可以打游戏');
            }
        }


        //定义一个实例化对象
        const xioami = new smartPhone('xiaomi',2333,'蓝色');
        console.log(xioami);
    </script>
</body>
</html>